package com.woniuxy.admin.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.admin.dto.AdminAccountDto;
import com.woniuxy.admin.entity.AdminLogin;
import com.woniuxy.admin.service.AdminLoginService;
import com.woniuxy.core.annotation.Permission;
import com.woniuxy.core.util.Result;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ...
 * @since 2024年05月22日
 */
@RestController
@RequestMapping("/adminLogin")
@Api(tags="管理员登录日志")
public class AdminLoginController {

    @Resource
    private AdminLoginService adminLoginService;
    /**
     * 分页查询登录日志
     * @param pageNum 当前页
     * @param pageSize 每页几条
     * @return
     */
    @GetMapping("/loadAllAdminLogin")
    @ApiOperation("分页查询管理员登录日志")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum",value ="当前页码" ),
            @ApiImplicitParam(name = "pageSize",value ="每页几条" )
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "OK",response = AdminLogin.class)
    })
    public Result loadAllAdminLogin(Integer pageNum,Integer pageSize){
        Page<AdminLogin> page=adminLoginService.loadAllAdminLogin(pageNum,pageSize);
        return Result.success("分页查询管理员登录日志成功",page);

    }
}

